import { RouteRecordRaw, createRouter, createWebHashHistory } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  { path: "/", redirect: "/home" },
  { path: "/home", name: "Home", component: () => import("@/views/Home.vue") },
  { path: "/demo", name: "Demo", component: () => import("@/views/Demo.vue") },
];

const router = createRouter({
  // 有hash模式 ，HTML5 模式（需要再服务器端配置回退路由）和历史模式 ，hash模式最简单，不利于seo
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
});

export default router;
